import { Demo1Component } from './demo1/demo1.component';
import { MaximumAndMinimumComponent } from './maximum-and-minimum/maximum-and-minimum.component';
import { Demo3Component } from './demo3/demo3.component';
import { Demo4Component } from './demo4/demo4.component';
import { Demo5Component } from './demo5/demo5.component';
import { Demo6Component } from './demo6/demo6.component';
import { Demo7Component } from './demo7/demo7.component';
import { Demo8Component } from './demo8/demo8.component';

export const SpinnerConfig = {
  location: 'Spinner',
  description: '微调器用于输入或编辑数值的，且带有便于鼠标操作的微调控件的仅限数值的单行文本框。无法输入非数字型字符。',
  description_en: 'A numeric-only, one-line text box that is used by the spinner to enter or edit values with a fine-tuning control that facilitates mouse operation. Unable to enter non-numeric characters.',
  component: [
    {
      demo: Demo1Component,
      codePath: 'showcase/spinner/demo1/demo1.component',
      demoTitle: '基础使用',
      demoTitle_en: 'Basic',
      demoDescription: '基础使用。组件宽度可以通过 style 进行设置。',
      demoDescription_en: 'Basic use. Component width can be set through the style property.'
    },
    {
      demo: Demo8Component,
      codePath: 'showcase/spinner/demo8/demo8.component',
      demoTitle: '尺寸大小',
      demoTitle_en: 'Size',
      demoDescription: '设置size可以使用两种尺寸（default, large）的数字输入框。高度分别对应32px、40px。',
      demoDescription_en: 'Setting size can use four sizes (default, large) number input box. The corresponding heights are 32px and 40px respectively.'
    },
    {
      demo: MaximumAndMinimumComponent,
      codePath: 'showcase/spinner/maximum-and-minimum/maximum-and-minimum.component',
      demoTitle: '最大值和最小值',
      demoTitle_en: 'Maximum and Minimum',
      demoDescription: '设置最大值和最小值。',
      demoDescription_en: 'Set the maximum and minimum.'
    },
    {
      demo: Demo3Component,
      codePath: 'showcase/spinner/demo3/demo3.component',
      demoTitle: '带提示信息',
      demoTitle_en: 'Prompt Message',
      demoDescription: '自定义提示信息。',
      demoDescription_en: 'Customize the prompt information.'
    },
    {
      demo: Demo4Component,
      codePath: 'showcase/spinner/demo4/demo4.component',
      demoTitle: '步长',
      demoTitle_en: 'Step',
      demoDescription: '可以按照给定的数值倍数来加减。',
      demoDescription_en: 'It can be added or subtracted according to a given number of multiples.'
    },
    {
      demo: Demo5Component,
      codePath: 'showcase/spinner/demo5/demo5.component',
      demoTitle: '禁用',
      demoTitle_en: 'Disable',
      demoDescription: '禁用组件，不可使用。',
      demoDescription_en: 'Disable components and cannot be used.',
    },
    {
      demo: Demo6Component,
      codePath: 'showcase/spinner/demo6/demo6.component',
      demoTitle: '数字输入框',
      demoTitle_en: 'Input number',
      demoDescription: '不显示加减按钮，只显示输入框，可用键盘上下调节。',
      demoDescription_en: 'The addition and subtraction buttons are not displayed, only the input box is displayed, which can be adjusted up and down with the keyboard.',
      devDebug: true,
    },
    {
      demo: Demo7Component,
      codePath: 'showcase/spinner/demo7/demo7.component',
      demoTitle: '不可输入',
      demoTitle_en: 'Not input',
      demoDescription: '数值输入框不可进行手动输入，只可通过点击按钮来调整数值。',
      demoDescription_en: 'The numerical input box cannot be manually entered, and the numerical value can only be adjusted by clicking the button.'
    }
  ],
  useRule: [],
  useSuggestion: [],
  selector: 'lv-spinner',
  snippet: `<lv-spinner [(ngModel)]="\${1:value}"></lv-spinner>`,
  api: [
    {
      attribute: 'ngModel',
      type: 'number | string',
      default: '-',
      description: `当前值，可双向绑定。`,
      description_en: `The current value can be bound in both directions.`,
    },
    {
      attribute: 'lvSize',
      type: 'default | large',
      default: 'default',
      description: `输入框大小。`,
      description_en: `Input size.`
    },
    {
      attribute: 'lvRequired',
      type: 'boolean',
      default: 'true',
      description: `是否不能为空。如果为true，内容清空时会自动变成ngModel初始化的值（默认值）。`,
      description_en: `Indicates whether the parameter cannot be empty. If the value is true, the value is automatically changed to the initial value of ngModel (default value) when the content is cleared.`
    },
    {
      attribute: 'lvMin',
      type: 'number',
      default: '-(2^53-1)',
      description: `最小边界值。`,
      description_en: `Minimum boundary value.`
    },
    {
      attribute: 'lvMax',
      type: 'number',
      default: '2^53-1',
      description: `最大边界值。`,
      description_en: `Maximum boundary value.`,
    },
    {
      attribute: 'lvStep',
      type: 'number',
      default: '1',
      description: `每次改变的步数，可以为小数。`,
      description_en: `The number of steps per change can be a decimal.`,
    },
    {
      attribute: 'lvDisabled',
      type: 'boolean',
      default: 'false',
      description: `是否禁用组件。`,
      description_en: `No disable components.`,
    },
    {
      attribute: 'lvOnlyInput',
      type: 'boolean',
      default: 'false',
      description: `是否为数字输入框。`,
      description_en: `Whether it is a number input box.`,
    },
    {
      attribute: 'lvReadOnly',
      type: 'boolean',
      default: 'false',
      description: `是否可通过输入修改。`,
      description_en: `Is it modifiable by input.`,
    },
    {
      attribute: 'lvPlaceHolder',
      type: 'string',
      default: '',
      description: `输入框默认文字。`,
      description_en: `placeholder.`,
    }
  ],
  event: [
    //  {
    //    event: 'onFocus',
    //    parameter: `--`,
    //    description: '输入框获取焦点时回调函数。'
    //  },
    {
      event: 'onBlur',
      parameter: `--`,
      description: '输入框失去焦点时回调函数。',
      description_en: 'The callback function when the input box loses focus.',
    },
    {
      event: 'onChange',
      parameter: `value: Changed value`,
      description: '值改变时回调函数。',
      description_en: 'The callback function when the value changes.',
    }
  ]
};
